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 { diff --git a/arch/arm64/boot/dts/apple/t6030.dtsi b/arch/arm64/boot/dts/apple/t6030.dtsi index 56e3da67947061..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 { @@ -255,6 +267,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 +292,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 +346,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>; }; }; @@ -1184,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 { 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