From 0cf81e8b2b2d9b314f2a1364c3662f63ce83cc03 Mon Sep 17 00:00:00 2001 From: Ilyas Akin Date: Sun, 15 Nov 2026 12:27:22 +0300 Subject: [PATCH 1/4] arm64: dts: apple: t6030: Add the CPU power of each OPP T6030's OPP tables have no opp-microwatt, so its CPUs have no energy model: the scheduler cannot place tasks by energy, and the power allocator thermal governor would have no power actors. Add per-CPU power for every OPP of both clusters, measured on a J514S (MacBook Pro 14", 11-core M3 Pro) through the SMC's cluster power keys (PPMC, PP0C): the cluster pinned to the state, all of its CPUs busy minus the cluster idle, divided by the number of CPUs, each state started cool. The values are fitted curves so that they rise monotonically. From 3576 MHz up the P cluster's power stays at about 19.5 W with all five CPUs busy, and the E cluster's 2748 MHz state draws what 2640 MHz does: the hardware limits the top states itself. Those states get the extrapolated curve. With the energy model, energy-aware scheduling is enabled on these machines (sched_energy_aware reads 1 with schedutil). Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 Signed-off-by: Ilyas Akin --- arch/arm64/boot/dts/apple/t6030.dtsi | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6030.dtsi b/arch/arm64/boot/dts/apple/t6030.dtsi index 56e3da67947061..e99755859b33bf 100644 --- a/arch/arm64/boot/dts/apple/t6030.dtsi +++ b/arch/arm64/boot/dts/apple/t6030.dtsi @@ -255,6 +255,23 @@ }; }; + /* + * opp-microwatt is the power one busy CPU adds at each state, measured + * on a J514S (11-core M3 Pro) with the SMC's cluster power keys (PPMC + * for the E cluster, PP0C for the P cluster): the cluster pinned to + * the state, all of its CPUs busy minus the cluster idle, divided by + * the number of CPUs, each state starting at 56-66 C. The values are + * curves fitted to the measurements so that they rise monotonically, + * ln(P/mW) = a + b ln f + c (ln f)^2 with f in GHz: + * E: a = 4.760, b = 1.046, c = 0.946 (rms deviation 11 mW), + * P: a = 5.591, b = 1.250, c = 0.499 (rms deviation 80 mW). + * + * From 3576 MHz up, the P cluster's power stops rising at about + * 19.5 W with all five CPUs busy, and the E cluster's at 2748 MHz is + * that of 2640 MHz: the hardware limits the top states by itself. + * Their values are the fitted curves extrapolated, the power these + * states would draw unlimited. + */ sawtooth_opp: opp-table-0 { compatible = "operating-points-v2"; opp-shared; @@ -263,41 +280,49 @@ opp-hz = /bits/ 64 <744000000>; opp-level = <1>; clock-latency-ns = <7700>; + opp-microwatt = <93000>; }; opp02 { opp-hz = /bits/ 64 <1044000000>; opp-level = <2>; clock-latency-ns = <21200>; + opp-microwatt = <122000>; }; opp03 { opp-hz = /bits/ 64 <1476000000>; opp-level = <3>; clock-latency-ns = <26400>; + opp-microwatt = <202000>; }; opp04 { opp-hz = /bits/ 64 <2004000000>; opp-level = <4>; clock-latency-ns = <40500>; + opp-microwatt = <381000>; }; opp05 { opp-hz = /bits/ 64 <2268000000>; opp-level = <5>; clock-latency-ns = <44400>; + opp-microwatt = <518000>; }; opp06 { opp-hz = /bits/ 64 <2448000000>; opp-level = <6>; clock-latency-ns = <47200>; + opp-microwatt = <635000>; }; opp07 { opp-hz = /bits/ 64 <2640000000>; opp-level = <7>; clock-latency-ns = <52000>; + opp-microwatt = <785000>; }; opp08 { opp-hz = /bits/ 64 <2748000000>; opp-level = <8>; clock-latency-ns = <52000>; + opp-microwatt = <883000>; }; }; @@ -309,101 +334,121 @@ opp-hz = /bits/ 64 <696000000>; opp-level = <1>; clock-latency-ns = <8600>; + opp-microwatt = <182000>; }; opp02 { opp-hz = /bits/ 64 <1092000000>; opp-level = <2>; clock-latency-ns = <18700>; + opp-microwatt = <300000>; }; opp03 { opp-hz = /bits/ 64 <1356000000>; opp-level = <3>; clock-latency-ns = <20700>; + opp-microwatt = <411000>; }; opp04 { opp-hz = /bits/ 64 <1596000000>; opp-level = <4>; clock-latency-ns = <24800>; + opp-microwatt = <536000>; }; opp05 { opp-hz = /bits/ 64 <1884000000>; opp-level = <5>; clock-latency-ns = <30700>; + opp-microwatt = <723000>; }; opp06 { opp-hz = /bits/ 64 <2172000000>; opp-level = <6>; clock-latency-ns = <34400>; + opp-microwatt = <954000>; }; opp07 { opp-hz = /bits/ 64 <2424000000>; opp-level = <7>; clock-latency-ns = <39600>; + opp-microwatt = <1199000>; }; opp08 { opp-hz = /bits/ 64 <2616000000>; opp-level = <8>; clock-latency-ns = <40000>; + opp-microwatt = <1414000>; }; opp09 { opp-hz = /bits/ 64 <2808000000>; opp-level = <9>; clock-latency-ns = <41800>; + opp-microwatt = <1658000>; }; opp10 { opp-hz = /bits/ 64 <2988000000>; opp-level = <10>; clock-latency-ns = <45300>; + opp-microwatt = <1914000>; }; opp11 { opp-hz = /bits/ 64 <3144000000>; opp-level = <11>; clock-latency-ns = <46700>; + opp-microwatt = <2160000>; }; opp12 { opp-hz = /bits/ 64 <3288000000>; opp-level = <12>; clock-latency-ns = <49200>; + opp-microwatt = <2406000>; }; opp13 { opp-hz = /bits/ 64 <3420000000>; opp-level = <13>; clock-latency-ns = <53900>; + opp-microwatt = <2651000>; }; opp14 { opp-hz = /bits/ 64 <3576000000>; opp-level = <14>; clock-latency-ns = <53700>; + opp-microwatt = <2964000>; }; opp15 { opp-hz = /bits/ 64 <3624000000>; opp-level = <15>; clock-latency-ns = <54000>; + opp-microwatt = <3065000>; }; opp16 { opp-hz = /bits/ 64 <3708000000>; opp-level = <16>; clock-latency-ns = <54000>; + opp-microwatt = <3250000>; }; opp17 { opp-hz = /bits/ 64 <3780000000>; opp-level = <17>; clock-latency-ns = <54100>; + opp-microwatt = <3414000>; }; opp18 { opp-hz = /bits/ 64 <3864000000>; opp-level = <18>; clock-latency-ns = <54300>; + opp-microwatt = <3614000>; }; opp19 { opp-hz = /bits/ 64 <3960000000>; opp-level = <19>; clock-latency-ns = <58400>; + opp-microwatt = <3853000>; }; opp20 { opp-hz = /bits/ 64 <4056000000>; opp-level = <20>; clock-latency-ns = <58700>; + opp-microwatt = <4105000>; }; }; From 711305598081ac1327084e83ff35e8693c51eb9b Mon Sep 17 00:00:00 2001 From: Ilyas Akin Date: Sun, 15 Nov 2026 12:27:22 +0300 Subject: [PATCH 2/4] arm64: dts: apple: t6030: Add CPU cooling cells and die temperature sensors Make the CPUs cooling devices (apple-soc-cpufreq registers them when the CPU nodes have #cooling-cells), as on t8122, and add seven SMC die temperature sensors as the first temperature channels of the SMC hwmon, so that board thermal zones can refer to them by index. The keys were picked on a J514S (MacBook Pro 14", 11-core M3 Pro) from the SMC key list by loading one CPU at a time: for each P core the key that rose most with only that core busy (Tp0U, Tp0a, Tp1I, Tp1Q, Tp0g for cpu@10100..10104, about 25 C, 10-15 C more than with any other core busy), and Te05 and Te0P, the two keys that rose most with the whole E cluster busy (single E cores barely warm any sensor). cpu@10105 is absent on the 11-core part, so its key is not identified. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 Signed-off-by: Ilyas Akin --- arch/arm64/boot/dts/apple/t6030.dtsi | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6030.dtsi b/arch/arm64/boot/dts/apple/t6030.dtsi index e99755859b33bf..10a4b4c36afb3f 100644 --- a/arch/arm64/boot/dts/apple/t6030.dtsi +++ b/arch/arm64/boot/dts/apple/t6030.dtsi @@ -84,6 +84,7 @@ operating-points-v2 = <&sawtooth_opp>; capacity-dmips-mhz = <851>; performance-domains = <&cpufreq_e>; + #cooling-cells = <2>; }; cpu_e01: cpu@1 { @@ -98,6 +99,7 @@ operating-points-v2 = <&sawtooth_opp>; capacity-dmips-mhz = <851>; performance-domains = <&cpufreq_e>; + #cooling-cells = <2>; }; cpu_e02: cpu@2 { @@ -112,6 +114,7 @@ operating-points-v2 = <&sawtooth_opp>; capacity-dmips-mhz = <851>; performance-domains = <&cpufreq_e>; + #cooling-cells = <2>; }; cpu_e03: cpu@3 { @@ -126,6 +129,7 @@ operating-points-v2 = <&sawtooth_opp>; capacity-dmips-mhz = <851>; performance-domains = <&cpufreq_e>; + #cooling-cells = <2>; }; cpu_e04: cpu@4 { @@ -140,6 +144,7 @@ operating-points-v2 = <&sawtooth_opp>; capacity-dmips-mhz = <851>; performance-domains = <&cpufreq_e>; + #cooling-cells = <2>; }; cpu_e05: cpu@5 { @@ -154,6 +159,7 @@ operating-points-v2 = <&sawtooth_opp>; capacity-dmips-mhz = <851>; performance-domains = <&cpufreq_e>; + #cooling-cells = <2>; }; cpu_p00: cpu@10100 { @@ -168,6 +174,7 @@ operating-points-v2 = <&everest_opp>; capacity-dmips-mhz = <1024>; performance-domains = <&cpufreq_p>; + #cooling-cells = <2>; }; cpu_p01: cpu@10101 { @@ -182,6 +189,7 @@ operating-points-v2 = <&everest_opp>; capacity-dmips-mhz = <1024>; performance-domains = <&cpufreq_p>; + #cooling-cells = <2>; }; cpu_p02: cpu@10102 { @@ -196,6 +204,7 @@ operating-points-v2 = <&everest_opp>; capacity-dmips-mhz = <1024>; performance-domains = <&cpufreq_p>; + #cooling-cells = <2>; }; cpu_p03: cpu@10103 { @@ -210,6 +219,7 @@ operating-points-v2 = <&everest_opp>; capacity-dmips-mhz = <1024>; performance-domains = <&cpufreq_p>; + #cooling-cells = <2>; }; cpu_p04: cpu@10104 { @@ -224,6 +234,7 @@ operating-points-v2 = <&everest_opp>; capacity-dmips-mhz = <1024>; performance-domains = <&cpufreq_p>; + #cooling-cells = <2>; }; cpu_p05: cpu@10105 { @@ -238,6 +249,7 @@ operating-points-v2 = <&everest_opp>; capacity-dmips-mhz = <1024>; performance-domains = <&cpufreq_p>; + #cooling-cells = <2>; }; l2_cache_0: l2-cache-0 { @@ -1229,6 +1241,55 @@ smc_hwmon: hwmon { compatible = "apple,smc-hwmon"; + #thermal-sensor-cells = <1>; + + /* + * CPU die temperatures: two for the E cluster and + * one per P core, the key that rose most with only + * that core busy on a J514S (11-core M3 Pro: about + * 25 C, 10-15 C more than with any other core busy). + * Single E cores barely warm their sensors, so the + * E cluster is covered by the two keys that rose + * most with the whole cluster busy. cpu_p05 is + * absent on the 11-core part and its key is not + * identified. Board thermal zones refer to these by + * channel index, so keep them first and in this + * order. + */ + temperature-Te05 { + apple,key-id = "Te05"; + label = "E-cluster Temperature 1"; + }; + + temperature-Te0P { + apple,key-id = "Te0P"; + label = "E-cluster Temperature 2"; + }; + + temperature-Tp0U { + apple,key-id = "Tp0U"; + label = "P-core 0 Temperature"; + }; + + temperature-Tp0a { + apple,key-id = "Tp0a"; + label = "P-core 1 Temperature"; + }; + + temperature-Tp1I { + apple,key-id = "Tp1I"; + label = "P-core 2 Temperature"; + }; + + temperature-Tp1Q { + apple,key-id = "Tp1Q"; + label = "P-core 3 Temperature"; + }; + + temperature-Tp0g { + apple,key-id = "Tp0g"; + label = "P-core 4 Temperature"; + }; }; smc_reboot: reboot { From 74f7ebde54a411ac194b4dac164661b48663a25e Mon Sep 17 00:00:00 2001 From: Ilyas Akin Date: Sun, 15 Nov 2026 12:27:22 +0300 Subject: [PATCH 3/4] arm64: dts: apple: t6030-j514s: Add critical CPU thermal zones Linux has no thermal zone on the J514S, so nothing shuts it down if its cooling fails. The SMC runs the fans and needs no help from Linux: in ten-minute load tests (five P cores, all eleven cores, five P cores plus the GPU) the fans held the hottest core sensor at 93-98 C at full clock, at up to about 6000 rpm. A power allocator zone throttling below that, like the fanless J613's, fought the fan curve: the fans stayed near 2300 rpm and the P cluster swung between 696 MHz and 4.06 GHz, averaging 3.1 GHz. So, as the Qualcomm X1E laptops do since commit 06eadce93697 ("arm64: dts: qcom: x1e80100: Drop unused passive thermal trip points for CPU"), add one zone per CPU die sensor with only a critical trip, at 110 C as on the J613, for an orderly shutdown if the platform's own cooling fails. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 Signed-off-by: Ilyas Akin --- arch/arm64/boot/dts/apple/t6030-j514s.dts | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6030-j514s.dts b/arch/arm64/boot/dts/apple/t6030-j514s.dts index 61c929da3d6004..6c36dfd9953347 100644 --- a/arch/arm64/boot/dts/apple/t6030-j514s.dts +++ b/arch/arm64/boot/dts/apple/t6030-j514s.dts @@ -21,6 +21,109 @@ chosen { asahi,t6030-dispext = "1"; }; + + /* + * The SMC runs the fans on its own. Under ten-minute loads (five P + * cores, all eleven cores, five P cores plus the GPU) they held the + * hottest core sensor at 93-98 C, at up to about 6000 rpm, with no + * throttling by Linux. A power allocator throttling below that fought + * the fan curve: the fans stayed near 2300 rpm and the P cluster swung + * between 696 MHz and 4.06 GHz. So, as on the Qualcomm X1E laptops, + * these zones carry only a critical trip, for an orderly shutdown if + * the platform's own cooling fails. 110 C matches the J613. + */ + thermal-zones { + cpu-e0-thermal { + polling-delay = <1000>; + thermal-sensors = <&smc_hwmon 0>; /* Te05 */ + + trips { + trip-critical { + temperature = <110000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + cpu-e1-thermal { + polling-delay = <1000>; + thermal-sensors = <&smc_hwmon 1>; /* Te0P */ + + trips { + trip-critical { + temperature = <110000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + cpu-p0-thermal { + polling-delay = <1000>; + thermal-sensors = <&smc_hwmon 2>; /* Tp0U */ + + trips { + trip-critical { + temperature = <110000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + cpu-p1-thermal { + polling-delay = <1000>; + thermal-sensors = <&smc_hwmon 3>; /* Tp0a */ + + trips { + trip-critical { + temperature = <110000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + cpu-p2-thermal { + polling-delay = <1000>; + thermal-sensors = <&smc_hwmon 4>; /* Tp1I */ + + trips { + trip-critical { + temperature = <110000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + cpu-p3-thermal { + polling-delay = <1000>; + thermal-sensors = <&smc_hwmon 5>; /* Tp1Q */ + + trips { + trip-critical { + temperature = <110000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + + cpu-p4-thermal { + polling-delay = <1000>; + thermal-sensors = <&smc_hwmon 6>; /* Tp0g */ + + trips { + trip-critical { + temperature = <110000>; + hysteresis = <0>; + type = "critical"; + }; + }; + }; + }; }; &framebuffer0 { From 0b16569a98c178bf2daa4af95fb194c32ba503c8 Mon Sep 17 00:00:00 2001 From: Ilyas Akin Date: Sun, 15 Nov 2026 12:27:22 +0300 Subject: [PATCH 4/4] hwmon: macsmc: SoC die keys for the 14-inch M3 Pro MacBook Pro The J514S has no entry in the board table, so it has no SoC die temperature zone. Give it its die keys: the CPU die keys of the board's device tree (Te05, Te0P, and Tp0U, Tp0a, Tp1I, Tp1Q, Tp0g, one per P core) and the four Tf2x keys that rose 11-14 C with only the GPU busy and about 1 C with all P cores busy. The GPU's own Tg keys read 0 C or slightly below on this machine even while it renders, so they are not used. Also expose the thermal pressure level (mTPL), which the J514S's SMC has. Assisted-by: Claude:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 Signed-off-by: Ilyas Akin --- drivers/hwmon/macsmc-hwmon.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/hwmon/macsmc-hwmon.c b/drivers/hwmon/macsmc-hwmon.c index 7e0a2312d2d292..e80bbabac53be8 100644 --- a/drivers/hwmon/macsmc-hwmon.c +++ b/drivers/hwmon/macsmc-hwmon.c @@ -78,6 +78,20 @@ static const struct macsmc_hwmon_board { const char *die_keys; const char *pressure_key; } macsmc_hwmon_boards[] = { + /* + * MacBook Pro (14-inch, M3 Pro): the CPU die keys of the board's + * device tree (two for the E cluster, one per P core), plus the four + * Tf2x keys that rose 11-14 C with only the GPU busy and about 1 C + * with all P cores busy. The GPU's own Tg keys read 0 C or slightly + * below on this machine even with the GPU rendering, so they are not + * used. Tf2D also follows the GPU but swings by more than 10 C with + * no GPU load, and is left out. + */ + { + .compatible = "apple,j514s", + .die_keys = "Te05,Te0P,Tp0U,Tp0a,Tp1I,Tp1Q,Tp0g,Tf24,Tf28,Tf29,Tf2E", + .pressure_key = "mTPL", + }, /* * MacBook Pro (16-inch, M3 Pro): key names used for the CPU * performance-core and GPU die sensors of M3-family machines. They