diff --git a/Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml b/Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml index 85acb1dcd6d96..96806c384ef57 100644 --- a/Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml +++ b/Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml @@ -60,7 +60,9 @@ properties: description: | PMP report region and cluster effort lane. Increasing firmware effort imposes a maximum-frequency QoS constraint alongside thermal cooling. - If the PMP is unavailable, cpufreq retains its fallback ceiling. + If the PMP is unavailable, cpufreq retains its fallback ceiling. A + disabled report node means the board does not run the PMP; where the + limit is optional for the SoC, no limit applies then. items: - items: - description: PMP report region diff --git a/arch/arm64/boot/dts/apple/t6050-base.dtsi b/arch/arm64/boot/dts/apple/t6050-base.dtsi index 471e849a8f46a..9d1b756a61cbe 100644 --- a/arch/arm64/boot/dts/apple/t6050-base.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-base.dtsi @@ -100,9 +100,9 @@ * The clusters' controllers (t6050-dieX.dtsi) assert apple,firmware-managed-thermal, which the * T6050 profile requires: the firmware keeps the voltage and PLL control. It does not lower a * cluster's requested state on its own: on J714s, under a sustained all-core load, the PMP's - * fast-die effort reaches its maximum while the clusters stay at their top state, so boards - * whose PMP runs give each cluster apple,fast-die-effort (t6050-j714s.dts). Other boards are - * not qualified yet. + * fast-die effort reaches its maximum while the clusters stay at their top state (also seen + * on K116s), so each cluster gets apple,fast-die-effort (t6050-peripherals.dtsi), which + * applies on every board that runs the PMP. */ mcluster_opp: opp-table-mcluster { compatible = "operating-points-v2"; diff --git a/arch/arm64/boot/dts/apple/t6050-j714s.dts b/arch/arm64/boot/dts/apple/t6050-j714s.dts index 383ec08bedbe2..281fd75da9b4e 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714s.dts @@ -465,26 +465,6 @@ status = "okay"; }; -/* - * The PMP runs a control loop on the die's hot-spot sensors and publishes an effort for each - * cluster in its FAST-DIE-CE range, in the order of the ADT's fast-die-ctrl-ce-map: MACC0, MACC1 - * and PACC_ANE (the P cluster). The OS enforces it as a frequency limit; the ADT's CLPC node lists - * the same range among its ptd-ranges. Without the limit the clusters keep their top state while - * the effort sits at its maximum under a sustained all-core load. Until the PMP reports that it - * runs (also on a boot without the PMP driver), cpufreq holds each cluster at its fallback limit. - */ -&cpufreq_mc0 { - apple,fast-die-effort = <&pmp0_report 0>; -}; - -&cpufreq_mc1 { - apple,fast-die-effort = <&pmp0_report 1>; -}; - -&cpufreq_pc { - apple,fast-die-effort = <&pmp0_report 2>; -}; - &pmc { /* PMP, CLPC and AP agents, once the PMP runs */ apple,static-voters = <0 1 3>; diff --git a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi index 488f3c3ee6d6e..1b45cbd058ebf 100644 --- a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi @@ -3702,3 +3702,28 @@ status = "disabled"; }; }; + +/* + * The PMP runs a control loop on die 0's hot-spot sensors and publishes an effort for each + * cluster in its FAST-DIE-CE range (pmp0_report, three lanes), in the order of the ADT's + * fast-die-ctrl-ce-map: MACC0, MACC1 and PACC_ANE (the P cluster). The ADT's CLPC node lists + * the same range among its ptd-ranges. The firmware does not lower the clusters' states itself + * (see the CPU OPP tables in t6050-base.dtsi): the OS enforces the effort as a frequency limit. + * The lanes are the SoC's, not a board's, so every T6050 board carries them. Die 1's clusters + * on a two-die part have no lane in this range and stay unmapped. + * + * The limit follows pmp0_report: a board that leaves it disabled does not run the PMP, and + * cpufreq then applies no limit, as without the property. Once the report is enabled, cpufreq + * holds each cluster at its fallback limit until the PMP reports that it runs. + */ +&cpufreq_mc0 { + apple,fast-die-effort = <&pmp0_report 0>; +}; + +&cpufreq_mc1 { + apple,fast-die-effort = <&pmp0_report 1>; +}; + +&cpufreq_pc { + apple,fast-die-effort = <&pmp0_report 2>; +}; diff --git a/drivers/cpufreq/apple-soc-cpufreq.c b/drivers/cpufreq/apple-soc-cpufreq.c index 09233d4b4208d..fe51e0cbb225e 100644 --- a/drivers/cpufreq/apple-soc-cpufreq.c +++ b/drivers/cpufreq/apple-soc-cpufreq.c @@ -1179,6 +1179,16 @@ static int apple_fast_die_init(struct cpufreq_policy *policy, parsed = of_parse_phandle_with_fixed_args(cluster, "apple,fast-die-effort", 1, 0, &args); + /* + * A disabled report means the board does not run the PMP: there is no + * effort to follow, as without the property. The SoC's dtsi can then + * describe the lanes once for every board. + */ + if (!parsed && !of_device_is_available(args.np) && + !priv->info->needs_thermal_policy) { + of_node_put(args.np); + return 0; + } /* Required thermal admission must fail closed with an older DT. */ if (parsed == -ENOENT && !priv->info->needs_thermal_policy) return 0;